﻿using System;

namespace Game
{
    public class Card
    {
        public enum eCardStatus
        {
            Visible,
            Invisible,
            Burned
        }

        public event EventHandler ChangedStatus;

        private char m_Symbol;
        private eCardStatus m_Status;

        public Card(char i_Symbol)
        {
            Status = eCardStatus.Invisible;
            Symbol = i_Symbol;
            ChangedStatus = null;
        }        
        
        public char Symbol
        {
            get { return m_Symbol; }
            set { m_Symbol = value; }
        }

        public eCardStatus Status
        {
            get { return m_Status; }
            private set { m_Status = value; }
        }

        public bool Equals(Card i_Other)
        {
            return m_Symbol == i_Other.m_Symbol;
        }

        public void ChangeMyStatus(CardEventArgs e)
        {
            Status = e.Status;

            if (ChangedStatus != null)
            {
                ChangedStatus(this, e);
            }
        }
    }
}
